
import pymysql as pymysql

db = pymysql.connect(
    host="localhost",
    port =3306,
    user = "root",
    database = "crawlerdemo",
    password= "csw.427.",
    charset= "utf8"
)
cursor = db.cursor()
cursor.execute("select * from m_stu")
print(cursor)

data = cursor.fetchall()

print(data)
cursor.close()
db.close()